import React from 'react';
import { inject, observer } from 'mobx-react';
import { Button } from 'antd';
@inject('homeStore')
@observer
class mobx extends React.Component {
  render() {
    const { name } = this.props.homeStore;
    return (
      <div>
        <Button
          onClick={() => {
            this.props.homeStore.setName('李四通过mobx改的');
          }}
          type="primary"
        >
          通过mobx修改内容
        </Button>
        <div>{name}</div>
      </div>
    );
  }
}

export default mobx;
